<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="pragma" content="no-cache">
		<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script charset="utf-8" src="js/tools/editor/kindeditor-min.js"></script>
<script charset="utf-8" src="js/tools/uploadFile.js"></script>
<style>
table {table-layout: fixed;font-size: 12px;}
tr {background-color: #F1F6F6;}
td {border: 1px solid #D9D9D9;color: black;padding: 2px;}
#allTargs a {text-decoration: none;table-layout: fixed;font-size: 14px;margin-right: 8px;}
#keyword a {text-decoration: none;table-layout: fixed;font-size: 14px;margin-right: 8px;}
</style>
<script type="text/javascript">
$(function(){
	/*KE.show({
				id : 'content',
				resizeMode : 1,
				imageUploadJson : 'ajax/uploadimage!uploadImageForEditor.action',
				items:['source', '|', 'fullscreen', 'undo', 'redo', 
				       'cut', 'copy', 'paste','plainpaste', 'wordpaste', 
				       '|', 'justifyleft', 'justifycenter', 'justifyright','justifyfull', 
				       '|', 'link', 'unlink', '|']
			});*/
});
//上传图片
function uploadImage(obj)
{
	var file=$("#file").val();
	if(file=="")
	{
		alert("选择图片");
		return false;
	}
          $.upload("image!uploadImage.action", {
              "directory": "uploadfile",
			  "base":  $("#base").val(),
              "image": $("#file")
          }, function (data) {
             if(data.info!="error")
             {
			 	$("#image").val(data.info);
				$("#img").remove();
			 	var html="<img id='img' style='width:50px;height:50px;' src='"+data.info+"'>";
			 	$(obj).parent().append(html);
				alert("上传成功");
             }
          });
 }
</script>
	</head>
	<body>
	    <input name="base" id="base" type="hidden"  value="<%=basePath%>"/>
	    <s:actionmessage cssStyle="color:red;font-size: 14px;"/>
	    <form action="websiteConfiger!configWebsite.action" method="post" >
	      <input type="hidden" name="websiteConfiger.bgimg" id="image" value="<s:property value="websiteConfiger.bgimg"/>">
	       <table style="width: 98%;" align="center">
			<tr><td width="15%">网站名称：</td><td><input type="text" name="websiteConfiger.websiteName" id="websiteName" value="<s:property value="websiteConfiger.websiteName"/>"/></td></tr>
			<tr><td>网站关键字：</td><td><input type="text" name="websiteConfiger.keywords" id="websiteName" value="<s:property value="websiteConfiger.keywords"/>"/></td></tr>
			<tr><td>网站描述：</td><td><input type="text" name="websiteConfiger.description" id="websiteName" value="<s:property value="websiteConfiger.description"/>"/></td></tr>
			<tr><td>电话：</td><td> <input type="text" id="tel" name="websiteConfiger.tel" value="<s:property value="websiteConfiger.tel"/>"/></td></tr>
			<tr><td>手机：</td><td> <input type="text" id="phone" name="websiteConfiger.phone" value="<s:property value="websiteConfiger.phone"/>"/></td></tr>
			<tr><td>Email：</td><td> <input type="text" id="email" name="websiteConfiger.email" value="<s:property value="websiteConfiger.email"/>"/></td></tr>
			<tr><td>地址：</td><td> <input type="text" id="address" name="websiteConfiger.address" size="50" value="<s:property value="websiteConfiger.address"/>"/></td></tr>
			<tr><td>网站背景图片：</td><td> <input type="file" id="file"/><a href="javascript:void(0);" onclick="uploadImage(this)">上传</a></td></tr>
			<tr><td>版权信息：</td><td> <input type="text" id="copyright" name="websiteConfiger.copyright" value="<s:property value="websiteConfiger.copyright"/>"/></td></tr>
			<tr><td>设置地图的缩放比例：</td><td> <input type="text" id="zoomLevel" name="websiteConfiger.zoomLevel" size="3" value="<s:property value="websiteConfiger.zoomLevel"/>" /><font color=red >必需是1~15之间的数字</font></td></tr>
			<tr><td>设置地图圆的半径：</td><td> <input type="text" id="radius" name="websiteConfiger.radius" size="3" value="<s:property value="websiteConfiger.radius"/>" /><font color=red >必需是数字</font></td></tr>
			<tr><td><input type="submit" value="保存"/></td><td></td></tr>
		  </table>
	    </form>
	</body>
</html>
